#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import random
reload(sys)
sys.setdefaultencoding('utf-8')
x=100
def a():
    print "funtion x:{0}".format(x)
    def b():
        print "funtion.funtion x:{0}".format(x)
        return "hello"
    return b
bbb=a()()
c=bbb
print bbb

#poke
#0-51 52张牌其中 0-12（1号桌） 13-25（2号桌） 26-38 39-51
#0，1，2，3 对应黑、红、梅、方
#牌序%13,余数为A-K
pokenum = range(52)
cols = ['黑','红','梅','方']
valus = ["A","2","3","4","5","6","7","8","9","10","J","Q","K"]
random.shuffle(pokenum)

pokes=[]
for poke in pokenum[:13]:
    col = cols[poke // 13]
    valu = valus[poke % 13]
    poke = (col,valu)
    pokes.append(poke)
    print type(poke)
pokes.sort(key=lambda num:num[1])
print pokes
print cols

